/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.gm.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Med EL MOUDDENE
 */
@Entity
@Table(name = "suivi")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Suivi.findAll", query = "SELECT s FROM Suivi s"),
    @NamedQuery(name = "Suivi.findByIdSuivi", query = "SELECT s FROM Suivi s WHERE s.idSuivi = :idSuivi")})
public class Suivi implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID_SUIVI")
    private Integer idSuivi;
    @Lob
    @Size(max = 65535)
    @Column(name = "LIBELLE")
    private String libelle;
    @JoinColumn(name = "ID_DOSSIER", referencedColumnName = "ID_DOSSIER")
    @ManyToOne(optional = false)
    private DossierMedical idDossier;

    public Suivi() {
    }

    public Suivi(Integer idSuivi) {
        this.idSuivi = idSuivi;
    }

    public Integer getIdSuivi() {
        return idSuivi;
    }

    public void setIdSuivi(Integer idSuivi) {
        this.idSuivi = idSuivi;
    }

    public String getLibelle() {
        return libelle;
    }

    public void setLibelle(String libelle) {
        this.libelle = libelle;
    }

    public DossierMedical getIdDossier() {
        return idDossier;
    }

    public void setIdDossier(DossierMedical idDossier) {
        this.idDossier = idDossier;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idSuivi != null ? idSuivi.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Suivi)) {
            return false;
        }
        Suivi other = (Suivi) object;
        if ((this.idSuivi == null && other.idSuivi != null) || (this.idSuivi != null && !this.idSuivi.equals(other.idSuivi))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.gm.entities.Suivi[ idSuivi=" + idSuivi + " ]";
    }
    
}
